﻿@{
    ViewBag.Title = "FindTrainnumberInfor";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="~/Scripts/jquery-1.8.2.min.js"></script>
<script>
    $(function () {
        $("#btn").click(function () {
            var Trainname = $("#Trainname").val();
            var Starttime = $("#Starttime").val();
            var Endtime = $("#Endtime").val();
            var Stop = $("#Stop").val();
            var Stoptime = $("#Stoptime").val();
            var operation = $("#operation").val();
            var Farenumber = $("#Farenumber").val();

            $.ajax({
                type: "post",
                url: "/Astart/AddTrainnumberInforDo",
                data: {
                    Trainname: Trainname,
                    Starttime: Starttime,
                    Endtime: Endtime,
                    Stop: Stop,
                    Stoptime: Stoptime,
                    operation: operation,
                    Farenumber: Farenumber
                },
                success: function (data) {
                    if (data > 0) {
                        alert("添加成功");
                        location.href = "/Astart/TrainMenage";
                    }
                    else {
                        alert("添加失败");
                    }
                }
            })
        })
    })

</script>
<ul id="myTab" class="nav nav-tabs" style="margin-top:50px">
    <li class="active">
        <a href="#home" data-toggle="tab">
            添加车次信息
        </a>
    </li>
</ul>
<div id="myTabContent" class="tab-content">
    <div class="tab-pane fade in active" id="home">
        <table>
            <tr>
                <td>车次名称</td>
                <td><input type="text" id="Trainname" /></td>
            </tr>
            <tr>
                <td>出发时间</td>
                <td><input type="text" id="Starttime" /></td>
            </tr>
            <tr>
                <td>抵达时间</td>
                <td><input type="text" id="Endtime" /></td>
            </tr>
            <tr>
                <td>经停站</td>
                <td><input type="text" id="Stop" /></td>
            </tr>
            <tr>
                <td>经停时间</td>
                <td><input type="text" id="Stoptime" /></td>
            </tr>
            <tr>
                <td>运行时间</td>
                <td><input type="text" id="operation" /></td>
            </tr>
            <tr>
                <td>车票剩余数量 </td>
                <td><input type="text" id="Farenumber" /></td>
            </tr>
            <tr>
                <td></td>
                <td><input type="button" id="btn" value="添加" /></td>
            </tr>
        </table>
    </div>

</div>

